package com.google.zahra.soap.data.structs;

import com.google.zahra.soap.MD5Hash;

public class ZahraStructsFactory {
  public static ChromeBotWorkPacket createChromeBotWorkPacket(final String[] urls) {
    ChromeBotWorkPacket packet = new ChromeBotWorkPacket();
    packet.setUrls(urls);
      
    String[] urlsCopy = java.util.Arrays.copyOf(urls, urls.length);
    java.util.Arrays.sort(urlsCopy, String.CASE_INSENSITIVE_ORDER);
        
    packet.setId(new MD5Hash(urlsCopy).getHash());
    return packet;
  }

}
